import request from '@/utils/request'

function formatRequestUri(name) {
  return 'hr/EmpSignFile/' + name
}
export function Query(query, paging) {
  return request({
    url: formatRequestUri('Query'),
    method: 'post',
    data: {
      Query: query,
      Index: paging.Index,
      Size: paging.Size,
      SortName: paging.SortName,
      IsDesc: paging.IsDesc
    }
  })
}

export function Add(data) {
  return request({
    url: formatRequestUri('Add'),
    method: 'post',
    data
  })
}

export function Delete(id) {
  return request({
    url: formatRequestUri('Delete'),
    method: 'get',
    params: {
      id
    }
  })
}

export function UpSign(data) {
  return request({
    url: formatRequestUri('UpSign'),
    method: 'post',
    data
  })
}
export function Accredit(data) {
  return request({
    url: formatRequestUri('Accredit'),
    method: 'post',
    data
  })
}
export function Gets() {
  return request({
    url: formatRequestUri('Gets'),
    method: 'get'
  })
}

export function PdfSign(accreditId, data) {
  return request({
    url: formatRequestUri('PdfSign'),
    method: 'post',
    timeout: 10000,
    data: {
      Id: accreditId,
      Value: data
    }
  })
}
